home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 8
/
The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO
/
prg_basi
/
inputb20.zip
/
MAIN.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-11-05
|
3KB
|
78 lines
Attribute VB_Name = "SampleMainModule"
' Example of how to use InputBox
' You do NOT have to include this file in your projects
' See InputBox.Bas for more information
'
' Tuomas Salste vbshop@netgate.net
Option Explicit
Sub Main()
' This is where the demo starts
Dim UserName As Variant
Dim UserPwd As Variant
ShowWelcomeMessage
' Ask the user's name (default to "H. Hacker")
UserName = InputBox("What is your name:", "Hello!", "H. Hacker")
If IsNull(UserName) Or UserName = "" Then
' If the user pressed 'Cancel' or typed nothing
MsgBox "Why didn't you tell me your name?", 16, "I won't play with you!"
Else
' Continue if the user pressed 'OK'
MsgBox "Hello, " & UserName & "!", 48, "Nice to meet you!"
' Ask the user's password (max. 8 chars)
' The password is shown as *'s on the screen
UserPwd = InputPassword("What is your password:", UserName, , , , , , 8)
If IsNull(UserPwd) Or UserPwd = "" Then
' If the user pressed 'Cancel' or gave no password
MsgBox "Are you afraid of telling me your password?", 32
Else
' If the user pressed 'OK'
MsgBox "Haha! Your password is '" & UserPwd & "'!", 48, "Stupid password"
End If
End If
ShowRegistration
' This is where the demo ends
End
End Sub
Private Sub ShowRegistration()
Dim Msg As String
Msg = Msg & "InputBox is shareware. This version is fully functional and comes with all the source code." & vbCrLf & vbCrLf
Msg = Msg & "If you find InputBox useful for your own programs, please read readme.txt for details on registration." & vbCrLf
Msg = Msg & "The registration fee is $10 and it includes all future updates." & vbCrLf & vbCrLf
Msg = Msg & "Tuomas Salste" & vbCrLf
Msg = Msg & "vbshop@netgate.net" & vbCrLf
Msg = Msg & "http://www.netgate.net/~vbshop/vb.html"
MsgBox Msg, 64, InputBoxVersionName
End Sub
Private Sub ShowWelcomeMessage()
' Just shows a message box with some introductory text in it
Dim Msg As String
Msg = Msg & "This is a demo program that demonstrates the use of the new InputBox functions." & vbCrLf & vbCrLf
Msg = Msg & "To use the functions, add the following files to your project:" & vbCrLf
Msg = Msg & "- InputBox.Frm" & vbCrLf
Msg = Msg & "- InputBox.Bas" & vbCrLf & vbCrLf
Msg = Msg & "Then simply call the InputBox function just like you did before" & vbCrLf
Msg = Msg & "You can also use InputUCase, InputLCase and InputPassword!" & vbCrLf
MsgBox Msg, 64, InputBoxVersionName
End Sub